package io.homework;

import java.io.FileInputStream;
import java.io.FileOutputStream;

public class Test4 {
    public static void main(String[] args) throws Exception {
        FileInputStream fis = new FileInputStream("test.txt");
        FileOutputStream fos = new FileOutputStream("test1.txt");

        byte[] data = new byte[1024];

        while (fis.read(data)!=-1){
            fos.write(data);
        }
        System.out.println("复制完成");
        fis.close();
        fos.close();
    }
}
